﻿@model Orchard.CounterField.Settings.CounterFieldSettings
@using Orchard.CounterField.Settings;

@*<fieldset>
    <div>
        <label class="forpicker" for="@Html.FieldIdFor(m => m.Type)">@T("Counter type")</label>
        <select id="@Html.FieldIdFor(m => m.Type)" name="@Html.FieldNameFor(m => m.Type)">
            @Html.SelectOption(Orchard.CounterField.Settings.CounterType.Integer, Model.Type == Orchard.CounterField.Settings.CounterType.Integer, T("Integer").ToString(), new { id = Html.FieldIdFor(m => m.Type) + "-text" })
            @Html.SelectOption(Orchard.CounterField.Settings.CounterType.Date, Model.Type == Orchard.CounterField.Settings.CounterType.Date, T("Date").ToString())
        </select>
        <span class="hint">@T("Defines what Type of input will be displayed in the counter.")</span>
    </div>
</fieldset>*@
<fieldset>
    <div>
        @Html.CheckBoxFor(m => m.Required)
        <label for="@Html.FieldIdFor(m => m.Required)" class="forcheckbox">@T("Required")</label>
        <span class="hint">@T("Check if the field is required.")</span>
    </div>
</fieldset>
<fieldset>
    <div class="editor-field">
        <label class="forpicker" for="@Html.FieldIdFor(m => m.Interval)">@T("Interval")</label>
        @Html.EditorFor(m => m.Interval, new { @class = "small text" })
        @Html.ValidationMessageFor(m => m.Interval)
        <span class="hint">@T("Defines the time between each counter increment -Example: '1000' = 1000 milliseconds")</span>
    </div>
</fieldset>
<fieldset id="FormatFieldSet">
    <div class="editor-field">
        <label class="forpicker" for="@Html.FieldIdFor(m => m.Format)">@T("Display Format")</label>
        @Html.EditorFor(m => m.Format, new { @class = "text" })
        @Html.ValidationMessageFor(m => m.Format)
        <span class="hint">@T("Format to display.  Example:  9999 (four digits) displays 0000 to 9999.")</span>
    </div>
</fieldset>
<fieldset>
    <div>
        <label for="@Html.FieldIdFor(m => m.Hint)">@T("Help text")</label>
        @Html.TextAreaFor(m => m.Hint, new { @class = "textMedium", rows = "5" })
        <span class="hint">@T("The help text is written under the field when the user is entering a value.")</span>
        @Html.ValidationMessageFor(m => m.Hint)
    </div>
</fieldset>
@*@using (Script.Foot())
{
    Script.Require("jQuery");
     
    <script type="text/javascript">
        //<![CDATA[
        $(function () {
            var field = $("select#@Html.FieldIdFor(m => m.Type)");
            if (field.val() === 'Integer') {
                $("#FormatFieldSet").show();
            } else {
                $("#FormatFieldSet").hide();
            }

            $(field).change(function (event) {
                if (field.val() === 'Integer') {
                    $("#FormatFieldSet").show();
                } else {
                    $("#FormatFieldSet").hide();
                }
            });

        })
        //]]>
    </script>
}*@